<?php

/**
 * VanillaShow form.
 *
 * @package    vanilla
 * @subpackage form
 * @author     Emiliano Nobis <emiliano.nobis@gmail.com>
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class VanillaShowForm extends BaseVanillaShowForm
{
  public function configure()
  {
      unset($this['created_at']);

      $this->embedI18n(array('it', 'en'));
      $this->widgetSchema->setLabel('it', 'Italiano');
      $this->widgetSchema->setLabel('en', 'Inglese');

      $orari = array();

      for($i = 0; $i <= 23; $i++){
          if($i <= 9)
              $orari['0'.$i.':00'] = '0'.$i.':00';
          else
              $orari[$i.':00'] = $i.':00';
          
          if($i <= 9)
              $orari['0'.$i.':30'] = '0'.$i.':30';
          else
              $orari[$i.':30'] = $i.':30';

      }

      $this->widgetSchema['hour'] = new sfWidgetFormChoice(array(
        'choices' => $orari
      ));
      
      $this->widgetSchema['date'] = new sfWidgetFormJQueryDate(array('culture' => 'it', 'format' => '%day%%month%%year%'));
      $this->widgetSchema['country'] = new sfWidgetFormI18nSelectCountry(array('culture' => 'en'));

      $this->setValidator('hour', new sfValidatorChoice(array('choices' => $orari)));
  }
}
